#include "EnumConverterCleanup.h"

REnumConverterCleanup * REnumConverterCleanup::iInstance = NULL;

REnumConverterCleanup & REnumConverterCleanup::Instance()
    {
    if(!iInstance) { User::Panic(KEnumConverter, KErrNotReady); }
    return *iInstance;
    }

void REnumConverterCleanup::CreateL()
    {
    if(iInstance) { User::Panic(KEnumConverter, KErrAlreadyExists); }
    iInstance = this;
    }

void REnumConverterCleanup::Close()
    {
    TInt count = iCloseItems.Count();
    for(TInt i = 0; i < count; ++i) { iCloseItems[i].Close(); }
    iCloseItems.Close();
    iInstance = NULL;
    }
